<!DOCTYPE html>
<html lang="en" class="h-full">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>{% block title %}{% endblock %}</title>
    <link rel="icon" type="image/x-icon" href="{{ url_for('static',filename='img/tx.jpg') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/iziToast.min.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
    <script>
        document.documentElement.setAttribute("data-theme", localStorage.getItem("theme") || 'light');
    </script>
</head>
<body class="h-full">
<div class="h-full grid grid-rows-2 grid-cols-1 lg:grid-rows-1 lg:grid-cols-5">
    <div class="lg:col-span-2 bg-[url('/static/img/auth_bj3.jpeg')] bg-center bg-cover m-2 rounded-lg lg:rounded-xl flex justify-center items-center">
        <div class="h-32 text-white backdrop-blur w-full flex flex-col justify-center items-center">
            <div class="text-5xl lg:text-6xl font-bold cursor-default">{% block imgText %}{% endblock %}</div>
            <div class="mt-3 underline_ cursor-default" id="yiYan">正在努力获取诗词...</div>
        </div>
    </div>
    <div class="lg:col-span-3 flex justify-center items-center {% block imgStyle %}{% endblock %} lg:mt-0">

        <div class="flex flex-col items-center z-[50] bg-white dark:bg-base-100 rounded-box px-5 py-2 shadow lg:shadow-none gap-4">
            <a href="{{ url_for('index.index') }}" class="rounded-full tooltip" data-tip="点击头像返回首页">
                <img class="h-24 w-24 rounded-full transition-all duration-300 hover:scale-110"
                     src="{{ url_for('static', filename='img/tx.jpg') }}" alt="">
            </a>
            {% block dataForm %}{% endblock %}
        </div>
    </div>
</div>

<script>
    fetch('{{ url_for('api.yiYan') }}').then(
        response => response.json()
    ).then(
        data => {
            let yiYan = document.getElementById('yiYan')
            if (data) {
                yiYan.innerText = `${data.content} -- ${data.origin.author}`
            } else {
                yiYan.innerText = '诗词获取失败...'
            }

        }
    )
</script>
<script src="{{ url_for('static', filename='js/iziToast.min.js') }}"></script>
<script src="{{ url_for('static', filename='js/tools.js') }}"></script>
{% block js %}{% endblock %}
{% include 'flash_macro.html' %}
</body>
</html>